﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace QMERP.Domain.Dtos
{
    public class RouterResponse
    {
        public long Id { get; set; }
        /// <summary>
        /// 应用级别字符串
        /// </summary>
        public string? Level { get; set; }
        /// <summary>
        /// 父Id
        /// </summary>
        public long? PId { get; set; }
        /// <summary>
        /// 类型
        /// </summary>
        public string Type { get; set; } = "";
        /// <summary>
        /// 名称
        /// </summary>
        public string Name { get; set; } = "";
        /// <summary>
        /// 路径
        /// </summary>
        public string? Path { get; set; }
        /// <summary>
        /// 组件路径
        /// </summary>
        public string? Component { get; set; }
        /// <summary>
        /// 路由重定向，有子集 children 时
        /// </summary>
        public string? Redirect { get; set; }
        /// <summary>
        /// 许可证
        /// </summary>
        public string? License { get; set; }
        public RouterMetaResponse Meta { get; set; } = new RouterMetaResponse();
        /// <summary>
        /// 排序
        /// </summary>
        public int? Sort { get; set; }
        /// <summary>
        /// 备注
        /// </summary>
        public string? Remark { get; set; }
        public bool IsEnable { get; set; }
    }
    public class RouterMetaResponse
    {
        /// <summary>
        /// 图标
        /// </summary>
        public string? Icon { get; set; }
        /// <summary>
        /// 模块名称
        /// </summary>
        public string Title { get; set; } = "";
        /// <summary>
        /// 是否隐藏
        /// </summary>
        public bool IsHide { get; set; } = false;
        /// <summary>
        /// 是否缓存
        /// </summary>
        public bool IsKeepAlive { get; set; } = true;
        /// <summary>
        /// 是否固定
        /// </summary>
        public bool IsAffix { get; set; } = false;
        /// <summary>
        /// 是否内嵌，开启条件，`1、isIframe:true 2、isLink：链接地址不为空`
        /// </summary>
        public bool IsIframe { get; set; } = false;
        // 是否外链
        public bool IsLink { get; set; } = false;
        /// <summary>
        /// 外链/内嵌时链接地址（http:xxx.com），开启外链条件，`1、isLink: 链接地址不为空`
        /// </summary>
        public string Link { get; set; } = "";
    }
}
